unit uDZRtlCompatible;

interface

uses
  SysUtils, SysConst, Windows;
  
{$ifndef delphi2006_or_higher}
procedure RaiseLastOSError(errorCode: Integer);
{$endif}

implementation

{$ifndef delphi2006_or_higher}
procedure RaiseLastOSError(errorCode: Integer);
var
  Error: EOSError;
begin
  if errorCode <> 0 then
    Error := EOSError.CreateResFmt(@SOSError, [errorCode,
      SysErrorMessage(errorCode)])
  else
    Error := EOSError.CreateRes(@SUnkOSError);
  Error.ErrorCode := errorCode;
  raise Error;
end;
{$endif}

end.
